package com.shinbada.modules.competitor.web;

import com.shinbada.common.json.AjaxJson;
import com.shinbada.core.web.BaseController;
import com.shinbada.modules.competitor.service.CompetitorExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 产品导入
 *
 * @author initcap
 * @version 2021-08-04
 */
@RestController
@RequestMapping(value = "/competitor/export")
@Api(tags = "产品导入")
public class CompetitorExportController extends BaseController {

    @Autowired
    private CompetitorExportService competitorExportService;

    @PostMapping(value = "productImport")
    @ApiOperation("导入产品")
    public AjaxJson productImport(MultipartFile file, Integer index) {

        String s = competitorExportService.productDataProcessing(file, index);

        return AjaxJson.success(s);
    }
}
